#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, k;
	cin >> n >> k;
	vector<int> an(n, 0);

	unordered_map<int, int> counts;

	for (int i = 0; i < n; i++) {
		cin >> an[i];
		counts[an[i]]++;
	}
	int max_count = 0;
	for (auto &pair : counts) {
		max_count = max(max_count, pair.second);
	}
	if (max_count <= k) {
		cout << "pigstd"  << endl;
	} else {
		int count = 0;
		for (auto &pair : counts) {
			//if(pair.second == max_count){// 未变换前的众数
			//    count ++;
			//}pair.second +k >=max_count;
			if (pair.second >= max_count - k && pair.second <= max_count + k) {
				count ++;
			}
			// WA 漏了情况就是众数代替后
		}
		cout <<  count << endl;
	}
	return 0;
}
